home *** CD-ROM | disk | FTP | other *** search
- /* ARexx Interface for GoldEd to get help with xref.library and AmigaGuide
- **
- ** $VER: xrefaguide.ged 1.6 (13.09.94)
- **
- ** NAME
- ** xrefaguide.ged
- **
- ** TEMPLATE
- ** EDIT/A,ADDPATTERN/A,CATEGORY,NOPATTERN/S,NOCASE/S
- **
- ** FUNCTION
- ** Gets the actual word from GoldEd and passes this to the aguidexref
- ** command to open help for this word. You can use patterns for the word.
- **
- ** INPUTS
- ** EDIT - set to WORD, if a requester should be opened, in which you
- ** can edit the word
- ** set to ARGS, if a requester should be opened, in which you
- ** can edit the argument line for AGuideXRef command
- ** ADDPATTERN- set to TRUE, if you want to add the '#?' string at the end
- ** of the given word.
- ** CATEGORY - category to search in
- ** NOPATTERN - set , if you don't want pattern in the word
- ** NOCASE - set , if you want case-insensetive word comparision
- **
- ** EXAMPLE
- ** The following command opens first a requester, in which you can edit the
- ** word and then searches in the AutoDoc category with case-insensetive
- ** comparision for the given word/pattern :
- **
- ** rx xrefaguide.ged 'WORD TRUE AutoDoc NOCASE'
- **
- ** SEE ALSO
- ** aguidexref,xref.library/ParseXRef(),dos.library/ParsePattern()
- **
- ** COPYRIGHT
- ** Stefan Ruppert , Windthorststraße 5 , 65439 Flörsheim , GERMANY
- **
- ** (C) Copyright 1994
- ** All Rights Reserved !
- **
- ** $HISTORY:
- **
- ** 13.09.94 : 001.006 : changed the ADDPATTERN pattern, because makexref
- ** recognizes now the varargs stubs, WORD Request title shows
- ** now AGuideXRef
- ** 02.09.94 : 001.005 : removed the GetEnv function and uses now this function from
- ** Rexx:GetEnv file !
- ** 10.08.94 : 001.004 : added lastword support,if a empty string is given
- ** 10.06.94 : 001.003 : changed ADDPATTERN '#?' TO '%|()'
- ** 22.05.94 : 001.002 : ADDPATTERN added and ESCCHARS removed
- ** 20.05.94 : 001.001 : ESCCHARS added
- ** 17.05.94 : 001.000 : bumped to version 1
- ** 17.05.94 : 000.001 : initial
- **
- */
-
- OPTIONS RESULTS /* enable return codes */
-
- if (LEFT(ADDRESS(), 6) ~= "GOLDED") then /* not started by GoldEd ? */
- address 'GOLDED.1'
-
- 'LOCK CURRENT' /* lock GUI, gain access */
- OPTIONS FAILAT 6 /* ignore warnings */
- SIGNAL ON SYNTAX /* ensure clean exit */
-
-
- /* ------------------------ INSERT YOUR CODE HERE: ------------------- */
-
- PARSE ARG EDIT ADDPATTERN ARGS
-
- linelength = 80 /* set linelength */
- columns = 3 /* set number of columns */
-
- 'QUERY CAT'
-
- if (result = "deutsch") then do
- wordtitle = 'Bearbeiten des Wortes für AGuideXRef :'
- argstitle = 'Bearbeiten der Argumente für AGuideXRef :'
- end
- else do
- wordtitle = 'Edit the word for AGuideXRef :'
- argstitle = 'Edit the Arguments for AGuideXRef :'
- end
-
- args = args || ' LINELENGTH ' || linelength || ' COLUMNS ' || columns
-
- ok = 0
-
- 'QUERY CURRENT VAR LINEPTR'
- 'QUERY LEN VAR LEN'
- 'QUERY SCREEN VAR SCREEN'
-
- line = Import(x2c(d2x(lineptr,8)),len)
- line = Translate(line, " ", "><~!""§$%&/()=|''\*+^;,:.-{}[]")
-
- 'QUERY COLUMN VAR POS'
-
- pos = Lastpos(" ", line, pos)+1
- line = Substr(line, pos)
-
- if (left(line,1) ~= ' ') then HWORD = word(line, 1)
- else HWORD = ''
-
- if (HWORD = '') then
- HWORD = GetEnv('AGuideXRef/LastWord')
-
- PATTERN = ''
- /* add : "(%|'('))" pattern */
- if (ADDPATTERN = 'TRUE') then
- PATTERN = '(%|''(''))'
-
- if (EDIT = "WORD") then do /* edit the word */
- 'REQUEST STRING TITLE="' || wordtitle || '" OLD="' || HWORD || '" VAR HWORD'
- ok = RC
- end
-
- args = HWORD || PATTERN || ' ' || args /* build the args line */
-
- if (EDIT = "ARGS") then do /* edit the argument line */
- 'REQUEST STRING TITLE="' || argstitle || '" OLD="' || ARGS || '" VAR ARGS'
- ok = RC
- end
-
- if (ok = 0) then /* run AGuideXRefV39 */
- do
- ADDRESS COMMAND 'RUN >NIL: <NIL: AGuideXRefV39 PUBSCREEN ' || screen || ' ' || args
- ADDRESS COMMAND 'SetEnv AGuideXRef/LastWord ' || HWORD
- end
- /* Examples :
- **
- ** show all xref-entries with Window inside :
- **
- ** #?Window#?
- **
- ** show the doc for ParsePattern
- **
- ** if(ParsePattern(mytest))
- */
-
- /* ---------------------------- END OF YOUR CODE --------------------- */
-
- 'UNLOCK' /* VERY important: unlock GUI */
- EXIT
-
- SYNTAX:
-
- SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
- 'UNLOCK'
- EXIT
-
-